package com.ldc.framework.adapter

import android.annotation.SuppressLint
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.viewpager2.adapter.FragmentStateAdapter

class FindFragmentAdapter constructor(f: FragmentActivity) : FragmentStateAdapter(f) {
    private val list: MutableList<Fragment> = mutableListOf()
    @SuppressLint("NotifyDataSetChanged")
    fun newData(list: MutableList<Fragment>) {
        this.list.addAll(list)
        notifyDataSetChanged()
    }

    override fun getItemCount(): Int = list.size

    override fun createFragment(position: Int): Fragment = list[position]


}